package com.ekalenchuk.module.service;

import java.io.Serializable;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.ekalenchuk.module.dao.ArticleDAO;
import com.ekalenchuk.module.domain.Article;

@Service
public class ArtivleServiceImpl implements ArticleService, Serializable {

	private static final long serialVersionUID = -666920756319497229L;

	@Autowired
	private ArticleDAO articleDAO;

	@Transactional
	public Article getArticle(Long articleId) {
		return articleDAO.getArticle(articleId);
	}

	@Transactional
	public void save(Article article) {
		articleDAO.save(article);
	}

	@Transactional
	public List<Article> getArticles() {
		return articleDAO.getArticles();
	}

	@Transactional
	public void removeArticle(Long articleId) {
		articleDAO.removeArticle(articleId);
	}

}
